<template>
  <el-dialog
    class="share_dialog"
    :model-value="modelValue"
    title="房间分享"
    style="width: 467px; height: auto !important"
    draggable
    :modal="false"
    :append-to-body="true"
    show
    @update:model-value="handleClose"
  >
    <template #header="{ close, titleId, titleClass }">
      <div class="custom_header">
        <span>房间分享</span>
      </div>
    </template>
    <div class="locked_content">
      <div style="position: relative">
        <el-input
          v-model="input3"
          style="max-width: 600px"
          placeholder="搜索昵称/ID"
          class="input-with-select"
        ></el-input>
        <el-icon
          style="
            position: absolute;
            right: 18px;
            top: 12px;
            color: #3662ec;
            font-weight: 600;
            font-size: 18px;
          "
        >
          <Search />
        </el-icon>
      </div>
      <el-scrollbar height="400px">
        <div v-for="item in 6" :key="item.id" class="friend_list_item">
          <el-checkbox value="Value 1" size="large" />
          <img src="@/assets/live/penquan.png" alt="" />
          <div class="info_div">
            <span>墨客</span>
            <span>个性签名个性签名个性签名个性签名个性签名</span>
          </div>
          <div>
            <div></div>
            <div
              style="
                margin-top: 20px;
                background: #ffe5cc;
                border-radius: 4px 4px 4px 4px;
                padding: 0 8px;
                display: inline-block;
              "
            >
              <span style="color: #3d3d3d; font-size: 12px; line-height: 22px; text-align: center">
                亚属性CP
              </span>
            </div>
          </div>
          <!-- works when <2.6.0, deprecated act as value when >=3.0.0 -->
        </div>
      </el-scrollbar>
    </div>

    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button @click="handleClose">确认</el-button>
    </template>
  </el-dialog>
</template>

<script setup>
import { defineProps, defineEmits } from "vue";

defineProps({
  modelValue: {
    // 接收父组件v-model传值
    type: Boolean,
    default: false,
  },
});
const emit = defineEmits(["update:modelValue"]);
// 关闭对话框时通知父组件更新状态
const handleClose = () => {
  emit("update:modelValue", false);
};
</script>
<style lang="scss">
.share_dialog {
  padding: 0;
  background: #222222 !important;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;

  .locked_content {
    padding: 10px 20px 10px 20px;
    color: #fff;
    font-weight: 400;
    font-size: 14px;
    line-height: 24px;
    font-style: normal;
    text-transform: none;
    .friend_list_item {
      display: flex;
      color: #fff;
      color: #fff;
      flex-direction: row;
      align-items: center;
      padding-right: 15px;
      margin: 20px 0;
      img {
        width: 48px;
        height: 48px;
      }
      .info_div {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        flex-wrap: nowrap;
        flex: 1;
        margin-left: 10px;
        span:first-child {
          width: 28px;
          height: 17px;
          font-family:
            Alibaba PuHuiTi 3,
            Alibaba PuHuiTi 30;
          font-weight: 400;
          font-size: 14px;
          color: #fff;
          line-height: 16px;
          text-align: center;
          font-style: normal;
          text-transform: none;
        }
        span:last-child {
          height: 17px;
          font-family:
            Alibaba PuHuiTi 3,
            Alibaba PuHuiTi 30;
          font-weight: 400;
          font-size: 12px;
          color: rgba(255, 255, 255, 0.6);
          line-height: 16px;
          text-align: center;
          font-style: normal;
          text-transform: none;
          margin-top: 6px;
        }
      }
    }

    .el-input {
      height: 40px;
      background: #222;
      .el-input__wrapper {
        border-radius: 30px;
      }
    }
  }
  .custom_header {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: flex-start;
    align-items: center;
    color: #fff;
    line-height: 15px;
  }

  .el-dialog__header {
    border-bottom: 1px solid rgba(216, 216, 216, 0.5);
    padding: 20px 20px 10px 20px;
    height: 56px;

    .el-dialog__headerbtn {
      height: 56px;
    }
  }

  .el-dialog__footer {
    padding: 15px;
    border-top: 1px solid rgba(216, 216, 216, 0.5);
    .el-button {
      width: 68px;
      height: 30px;
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 4px 4px 4px 4px;

      span {
        font-weight: 400;
        font-size: 12px;
        color: #ff4e6c;
        line-height: 22px;
        text-align: left;
        font-style: normal;
        text-transform: none;
      }
    }
    .el-button:first-child {
      span {
        color: #8a8a8a;
      }
    }
  }
}
</style>
